package com.xxxx.car.appointment.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xxxx.car.appointment.mapper.StatementItemMapper;
import com.xxxx.car.appointment.domain.StatementItem;
import com.xxxx.car.appointment.service.IStatementItemService;

import javax.annotation.Resource;

/**
 * 结算单明细Service业务层处理
 * 
 * @author Huang
 * @date 2024-09-02
 */
@Service
public class StatementItemServiceImpl extends ServiceImpl<StatementItemMapper,StatementItem> implements IStatementItemService
{
    @Resource
    private StatementItemMapper statementItemMapper;

    /**
     * 查询结算单明细
     * 
     * @param id 结算单明细主键
     * @return 结算单明细
     */
    @Override
    public StatementItem selectStatementItemById(Long id)
    {
        return statementItemMapper.selectStatementItemById(id);
    }

    /**
     * 查询结算单明细列表
     * 
     * @param statementId 结算单明细
     * @return 结算单明细
     */
    @Override
    public List<StatementItem> selectStatementItemList(Long statementId)
    {
        return statementItemMapper.selectStatementItemList(statementId);
    }

    /**
     * 新增结算单明细
     * 
     * @param statementItemList 结算单明细
     * @return 结果
     */
    @Override
    public int insertStatementItem(List<StatementItem> statementItemList)
    {
        StatementItem statementItem = statementItemList.get(0);
        System.out.println(statementItem.getOriginalPrice());
        return statementItemMapper.insertStatementItemList(statementItemList);
    }

    /**
     * 修改结算单明细
     * 
     * @param statementItem 结算单明细
     * @return 结果
     */
    @Override
    public int updateStatementItem(StatementItem statementItem)
    {
        return statementItemMapper.updateStatementItem(statementItem);
    }

    /**
     * 批量删除结算单明细
     * 
     * @param ids 需要删除的结算单明细主键
     * @return 结果
     */
    @Override
    public int deleteStatementItemByIds(Long[] ids)
    {
        return statementItemMapper.deleteStatementItemByIds(ids);
    }

    /**
     * 删除结算单明细信息
     * 
     * @param statementId 结算单明细主键
     * @return 结果
     */
    @Override
    public void deleteStatementItemByStatementId(Long statementId)
    {
        statementItemMapper.deleteStatementItemStatementId(statementId);
    }
}
